package net.sf.rose.redis;

import redis.clients.jedis.JedisPubSub;

/**
 * Redis消息订阅客户端
 * @author fengjian
 *
 */
public class RedisMsgPubSubListener extends JedisPubSub {

	@Override
	public void onMessage(String channel, String message) {
		System.out.println("channel:" + channel + "receives message :" + message);
		//this.unsubscribe();//取消订阅
	}

	@Override
	public void onSubscribe(String channel, int subscribedChannels) {
		System.out.println("channel:" + channel + "is been subscribed:" + subscribedChannels);
	}

	@Override
	public void onUnsubscribe(String channel, int subscribedChannels) {
		System.out.println("channel:" + channel + "is been unsubscribed:" + subscribedChannels);
	}
}